<?php


namespace app\model;

class Article extends Base
{
    protected $autoWriteTimestamp = true;
    protected $resultSetType = 'collection';
    protected $updateTime = '';
    protected $createTime = 'addTime';

    public function getStatusTextAttr($value,$data){
        $status = ['0' => '启用','1' => '未启用'];
        return $status[$data['status']];
    }

    public function getTypeTextAttr($value,$data){
        $status = ['0' => '商家','1' => '官方','2' => '用户'];
        return $status[$data['authorType']];
    }

    public function getArtileTypeTextAttr($value,$data){
        $status = ['0' => '三图','1' => '单图','2' => '推荐'];
        return $status[$data['type']];
    }
    public function getRecommendTextAttr($value,$data){
        $status = ['0' => '未推荐','1' => '推荐'];
        return $status[$data['recommend']];
    }


}
